<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:p="http://primefaces.org/ui" xmlns:a4j="http://richfaces.org/a4j"
	xmlns:c="http://java.sun.com/jsp/jstl/core">
<h:head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</h:head>
<h:body>
	<ui:composition template="template.xhtml">

		<ui:define name="title">mehmet emmy</ui:define>
		<ui:define name="body">

			<h:form enctype="multipart/form-data" id="uploadDeneme">
				<p:growl id="messages" showDetail="true" />
				<p:fileUpload fileUploadListener="#{UploadPicBean.handleFileUpload}"
					mode="advanced" update=":uploadDeneme:basic" multiple="true"
					showButtons="false" sizeLimit="100000"
					allowTypes="/(\.|\/)(gif|jpe?g|png)$/" />

				<p:contextMenu for="basic">  
			        <p:menuitem value="Delete" update="basic" 
			        	icon="ui-icon-close" actionListener="#{UploadPicBean.deleteFile}"/>  
    			</p:contextMenu>
    			
				<p:dataTable id="basic" var="resList" rowKey="#{resList.fileName}"  
                 selection="#{UploadPicBean.removeFile}" selectionMode="single"
					value="#{UploadPicBean.fileList}">
					<f:facet name="header">  
            			Uploaded Files  
        			</f:facet>

					<p:column id="modelHeader">
						<f:facet name="header">  
                    		File Name  
            			</f:facet>
						<h:outputText value="#{resList.fileName}" />
					</p:column>

					<p:column>
						<f:facet name="header">  
                    		Size 
           				 </f:facet>
						<h:outputText value="#{resList.size}" />
					</p:column>

					<p:column>
						<f:facet name="header">  
                    		Content Type  
            			</f:facet>
						<h:outputText value="#{resList.contentType}" />
					</p:column>

					<f:facet name="footer">
						<p:commandButton value="Save" update=":uploadDeneme" id="ajax"
						action="#{UploadPicBean.uploadControl}" />
					</f:facet>
				</p:dataTable>
			</h:form>
		</ui:define>
	</ui:composition>
</h:body>
</html>